﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wicresoft.EKA.Atrium.WebService.CMDBClassManager;

namespace Wicresoft.EKA.Atrium.WebService
{
    public class CMDBClassMgr
    {
        public void ListClasses()
        {
            System.Net.ServicePointManager.ServerCertificateValidationCallback = TrustAllCertificatePolicy.CheckValidationResult;
            atrium_classes proxy = new atrium_classes();

            proxy.CookieContainer = new System.Net.CookieContainer();
            //proxy.


            proxy.Sercuirty = Security.GetSecuritySoapHeader("Demo", "Pass01!");

            //proxy.Credentials = new NetworkCredential("admin", "Pass01!", "");

            var x = proxy.ListClasses(new ListClasses()
                    {

                    });

            //proxy.Sercuirty = Security.GetSecuritySoapHeader("Demo", "Pass01!");
            var atrries = proxy.GetAttributes(new GetAttributes()
                   {
                       loginInfo=new LoginInfo()
                       {
                          authentication="", 
                       },
                       classNameId = new ClassNameId()
                               {
                                   className = "BMC_ApplicationService",
                                   namespaceName = "BMC.CORE"
                               },
                       attributeNames = new string[] { "Name" },
                   });

            Console.ReadLine();


            //proxy.CreateAttribute(new CreateAttribute()
            //    {
            //        attributeId = 600079600,
            //        attributeInfo=new AttributeInfoIn()
            //        {
            //            fieldId=600079600,
            //            entryMode=AttributeEntryModeIn.OPTIONAL_ENTRY,
            //            //createMode=AttributeCreateMode.PROTECTED
            //        },
            //        attributeName = "attr11",
            //        classNameId = new ClassNameId()
            //        {
            //            className = "BMC_ApplicationService",
            //            namespaceName = "BMC.CORE"
            //        },
            //        //extensions=
            //        fieldId = 600079600,

            //    });

            //proxy.SetClass(new SetClass()
            //    {

            //    });

        }
    }
}
